
import torch
import json
import fileinput
from torch.utils.tensorboard import SummaryWriter

writer = SummaryWriter()

embedded = torch.rand(100, 50)
meta = list(map(lambda x: x.strip(), fileinput.FileInput('./vocab100.csv', encoding='utf-8')))
writer.add_embedding(embedded, metadata=meta)
writer.close()
